home *** CD-ROM | disk | FTP | other *** search
- { MiniDisplay - TransDisplay Demonstration. Very simple: just}
- { demonstrates the various output calls.}
-
- { The project should include MiniDisplay.pas (this file),}
- { TransDisplay.pas (or a project made from TransDisplay.pas),}
- { TransSkelpas (or a project made from TransSkelpas), MacPasLib and MacTraps.}
-
- { 4 October 1986 Paul DuBois}
- { 10 January 1987 Owen Hartnett Lightspeed Pascal version }
- { Ωhm Software, 163 Richard Drive, Tiverton, RI 02878 }
-
- PROGRAM MiniDisplay;
-
- USES
- TransSkelPas, TransDisplay;
-
- PROCEDURE DoFileMenu (item : integer); { ignored - there's only Quit }
- BEGIN
- SkelWhoa; { tell SkelMain to quit }
- END;
-
- VAR
- r : Rect;
- m : MenuHandle;
- w : WindowPtr;
- theStr : Str255;
- myPtr : Ptr;
-
- BEGIN
- SkelInit; { initialize }
- TransDisplayInit;
- SkelApple('', NIL); { handle desk accessories }
-
- m := NewMenu(2, 'File'); { create menu }
- AppendMenu(m, 'Quit/Q');
- SkelMenu(m, @DoFileMenu, NIL); { tell TransSkel to handle it }
-
-
- SetRect(r, 100, 75, 400, 250);
- w := NewDWindow(r, 'MiniDisplay', false, WindowPtr(-1), false, longint(0));
-
- DisplayString('This is MiniDisplay, a minimal demonstration of');
- Displayln;
- DisplayString('TransDisplay. The following types of output may');
- Displayln;
- DisplayString('be written with the built-in output calls:');
-
- Displayln;
- DisplayString('Arbitrary length text:');
- theStr := 'Some Text';
- myPtr := Ptr(longint(@theStr) + 1);
- DisplayText(myPtr, longint(theStr[0]));
- Displayln;
- DisplayString('String:');
- DisplayString('"this is a string"');
- Displayln;
- DisplayString('Char: ');
- DisplayChar('x');
- DisplayString(' Hex char: ');
- DisplayHexChar('x');
- Displayln;
- DisplayString(' Int: ');
- DisplayInt(1023);
- DisplayString(' Hex int: ');
- DisplayHexInt(1023);
- Displayln;
- DisplayString(' Long: ');
- DisplayLong(longint(32768));
- DisplayString(' Hex long: ');
- DisplayHexLong(longint(32768));
- DisplayString(' Boolean: ');
- DisplayBoolean(true);
- DisplayString(', ');
- DisplayBoolean(false);
- Displayln;
- DisplayString('Carriage Return: ');
- Displayln;
- DisplayString('Select quit from the File menu to exit');
- SetDWindowPos(w, 0); { scroll back to top }
- ShowWindow(w);
-
- SkelMain; { loop 'til Quit selected }
- SkelClobber; { clean up }
- END.